<template>
    <div>
      <div class="qrcode" ref="qrCodeUrl"></div>
      <!-- <vue-qr text="https://blog.csdn.net/weixin_42601136" :size="200"></vue-qr> -->
    </div>
  </template>
  
  <script>
  import QRCode from "qrcodejs2";
//   import vueQr from "vue-qr";
  export default {
    data() {
      return {
        qrcode:""
        // imageUrl: require("../assets/img/logo.png"),
      };
    },
    components: {
    //   vueQr,
    },
    methods: {
      creatQrCode() {
        this.qrcode = new QRCode(this.$refs.qrCodeUrl, {
          text: "http://zhenliu.xyz/view/#/receive?a=1&b=2", // 需要转换为二维码的内容
          width: 100,
          height: 100,
          colorDark: "#000000",
          colorLight: "#ffffff",
          correctLevel: QRCode.CorrectLevel.H,
        });
      },
    },
    mounted() {
      this.creatQrCode();
    },
  };
  </script>
  
  
  <style scoped>
  .qrcode {
    display: inline-block;
    width: 132px;
    height: 132px;
    background-color: #fff;
    padding: 6px;
    box-sizing: border-box;
  }
  </style>
  